/**
 * Created by Administrator on 2017/2/24 0024.
 */
var islogin = 1;

$(function () {
    $.ajax({
        url: "/door/front/teacher/getCurTea?" + new Date().getTime(),
        async: false,
        success: function (str) {
            if (check(str)) {
                $("#name").text(str.teachername);
                $("#classroom").text(str.name);
            }
        }
    });
});

function check(str){
    if (str != null && str != "") {
        if (str.errorcode != undefined) {
            if (str.errorcode == 1) {
                if (islogin == 1) {
                    layer.msg(str.errormessage,{time:1000});
                    // window.location.href = "/door/front_end/pc/teacher/login_pc_teacher.html";
                    islogin = 0;
                }
            }
            return false;
        } else {
            return true;
        }
    } else {
        return false;
    }
}